package cc.iteachyou.template.utils;


import cc.iteachyou.template.tools.StringUtil;
import cn.hutool.crypto.SecureUtil;

public class CacheHelper {
    private static CacheHelper helper = null;

    /**
     * 构造函数
     */
    private CacheHelper(){}

    /**
     * 获取模板引擎助手实例
     * @return
     */
    public static CacheHelper getInstance(){
        if(helper == null){
            helper = new CacheHelper();
        }
        return helper;
    }

    public String get(String key){
        if(StringUtil.isBlank(key)){
            return null;
        }
        key = SecureUtil.md5(key);

        // TODO

        return "";
    }

    public Boolean set(String key, String content) {
        if(StringUtil.isBlank(key)){
            return false;
        }
        key = SecureUtil.md5(key);

        // TODO 缓存

        return true;
    }
}
